﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using System.Collections;
using Microsoft.Xna.Framework.Graphics;

namespace Space_Cleaner.SpaceCleaner
{
    class SC_TextureManager
    {
        private static SC_TextureManager instance;
        private ContentManager contentMgr;

        private Hashtable table;

        public static SC_TextureManager getInstance()
        {
            if (SC_TextureManager.instance == null)
                SC_TextureManager.instance = new SC_TextureManager();
            return SC_TextureManager.instance;
        }


        public void init(ContentManager _content)
        {
            this.contentMgr = _content;
            this.table = new Hashtable();
        }

        public void loadTextures()
        {
            _loadTexture("curhand");
            _loadTexture("hit");
            _loadTexture("mag");
            _loadTexture("fire");
            _loadTexture("HUD");
            _loadTexture("SingleBar");
            _loadTexture("earthPicture");
            _loadTexture("schrott1");
            _loadTexture("schrott2");
            _loadTexture("spacecraft1");
            _loadTexture("star1");
        }

        private void _loadTexture(String _name)
        {
            this.table.Add(_name, contentMgr.Load<Texture2D>(_name));
        }

        public static Texture2D getTexture(String _name)
        {
            return (Texture2D)SC_TextureManager.getInstance().table[_name];
        }
    }
}
